/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package exatrez.model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Mansur
 */
@Entity
@Table(name = "ship_visitfl_counter")
@NamedQueries({
    @NamedQuery(name = "ShipVisitFlowCounter.findAll", query = "SELECT s FROM ShipVisitFlowCounter s")})
public class ShipVisitFlowCounter implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "svfl_counter_id")
    private Integer svFlowCounterId;
    
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "user_id")
    private User user;
    
    @Column(name = "ship_visit_target")
    private Integer target;
    
    @Column(name = "ship_visited")
    private Integer visited;
    
    @Column(name = "rejected")
    private Integer rejected;
    
    @Column(name = "year")
    private String year;
    
    @Embedded
    private InfoAudit infoAudit;

    public ShipVisitFlowCounter() {
    }

    public Integer getSvFlowCounterId() {
        return svFlowCounterId;
    }

    public void setSvFlowCounterId(Integer svFlowCounterId) {
        this.svFlowCounterId = svFlowCounterId;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public Integer getTarget() {
        return target;
    }

    public void setTarget(Integer target) {
        this.target = target;
    }

    public Integer getVisited() {
        return visited;
    }

    public void setVisited(Integer visited) {
        this.visited = visited;
    }

    public Integer getRejected() {
        return rejected;
    }

    public void setRejected(Integer rejected) {
        this.rejected = rejected;
    }

    public String getYear() {
        return year;
    }

    public void setYear(String year) {
        this.year = year;
    }

    public InfoAudit getInfoAudit() {
        return infoAudit;
    }

    public void setInfoAudit(InfoAudit infoAudit) {
        this.infoAudit = infoAudit;
    }
    
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (svFlowCounterId != null ? svFlowCounterId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ShipVisitFlowCounter)) {
            return false;
        }
        ShipVisitFlowCounter other = (ShipVisitFlowCounter) object;
        if ((this.svFlowCounterId == null && other.svFlowCounterId != null) || (this.svFlowCounterId != null && !this.svFlowCounterId.equals(other.svFlowCounterId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "exatrez.model.ShipVisitFlowCounter[ svFlowCounterId=" + svFlowCounterId + " ]";
    }
}
